﻿using GN.Pay.TradeChannel.AliPay.Request;
using GN.Pay.TradeChannel.DefaultImpl;
using GN.Pay.Utils;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace GN.Pay.TradeChannel.AliPay
{
    /// <summary>
    /// App 支付请求
    /// </summary>
    [Serializable]
    public class AliPayAppService : AliPayServiceBase
    {
        /// <summary>
        /// 实例化 AliPayAPPService
        /// </summary>
        public AliPayAppService() : base()
        {

        }

        public override ChannelType ChannelType
        {
            get
            {
                return ChannelType.NativeApp;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public override string ChannelId
        {
            get
            {
                return "AliPay.APP";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public override string ChannelName
        {
            get
            {
                return "支付宝手机APP支付";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public override ITradePayApplyResult PayApply(IOrderPayApply order)
        {
            var config = this.channelConfigure;
            var request = new AppPayRequest(this, order, config);
            return request.Build(this, config);
        }
    }
}
